[EventTiming] Attempt to fix some flaky tests This CL attempts to fix test flakiness. * For the click counts, remove tests about mouseout/mouseover since those could fail under certain starting positions of the mouse, and the test has a pretty high flakiness score right now. * For other tests, fix flakiness by making sure that PerformanceObserver callbacks where mousedown is not present are ignored. This is possible since a click triggers mousedown, mouseup, click, etc., so we cannot just assume that mousedown will always be present at the callback. Bug: 1074048 Change-Id: I95a082948c105cf18b51376c9d6421195b23b718 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2163775 Reviewed-by: Yoav Weiss <yoavweiss@chromium.org> Commit-Queue: Nicolás Peña Moreno <npm@chromium.org> Cr-Commit-Position: refs/heads/master@{#763352} 
diff --git a/event-timing/crossiframe.html b/event-timing/crossiframe.html index 0376fb9..dfbd289 100644 --- a/event-timing/crossiframe.html +++ b/event-timing/crossiframe.html 
@@ -51,13 +51,18 @@  promise_test(async t => {  assert_implements(window.PerformanceEventTiming, "Event Timing is not supported");  clickTimeMin = performance.now(); - let observedEntries = false; + let observedMouseDown = false;  const observerPromise = new Promise(resolve => {  new PerformanceObserver(t.step_func(entries => { - assert_false(observedEntries, + const mouseDowns = entries.getEntriesByName('mousedown'); + // Ignore the callback if there were no mousedown entries. + if (mouseDowns.length === 0) + return; + + assert_false(observedMouseDown,  "Observer of main frames should only capture main-frame event-timing entries"); - validateEntries(entries.getEntriesByName('mousedown')); - observedEntries = true; + validateEntries(mouseDowns); + observedMouseDown = true;  resolve();  })).observe({type: 'event'});  });